#ifndef _GWLIB_GW_DIR_H_
#define _GWLIB_GW_DIR_H_

#include <string>
#include <vector>
#include <sys/stat.h>

namespace dicom {

struct GwToken;

struct DirEntry {
  std::string id;
  std::string name;
  bool is_folder;
  size_t size;
  time_t mtime;
};

int CreateDir(GwToken* t,
              const std::string& pid,
              const std::string& name,
              DirEntry* out);

int RenameDir(GwToken* t,
              const std::string& id,
              const std::string& new_name,
              DirEntry* out);

int DeleteDir(GwToken* t,
              const std::string& id);

int Lookup(GwToken* t, 
           const std::string& pid,
           const std::string& name,
           DirEntry* out);

typedef std::vector<DirEntry> DirEntryList;
int ReadDir(GwToken* t, 
            const std::string& pid,
            DirEntryList* items);

extern int ParseSingleDirEntryResult(const std::string& s, DirEntry* out);

}

#endif // _GWLIB_GW_DIR_H_
